package com.mundus.engine.assets;

import org.lwjgl.util.vector.Matrix4f;
import org.lwjgl.util.vector.Vector3f;
import org.lwjgl.util.vector.Vector4f;

/***
 * Math helper functions
 * @author Johannes du Randt
 */
public class MathHelper {
	
	/**
	 * Converts degrees to radians
	 * @param degrees Degrees
	 * @return Radians
	 */
	public static float degreesToRadians(float degrees){
		return (float)(degrees * Math.PI/180);
	}
	
	/**
	 * Converts radians to degrees
	 * @param radians Radians
	 * @return Degrees
	 */
	public static float radiansToDegrees(float radians){
		return (float)(radians * 180/Math.PI);
		
	}	
	
	/**
	 * Parse Vector4f to Matrix4f
	 * @param v vector to parse
	 * @return parsed matrix
	 */
	public static Matrix4f parseRotation( Vector4f v){
		return Matrix4f.rotate(v.w, new Vector3f(v.x, v.y, v.z), null, null);
	}
}
